<template>
  <el-row>
    <el-col :span="24">
      <el-menu
        class="menuItem"
        router
        unique-opened
        @open="handleOpen"
        @close="handleClose"
        background-color="#545c64"
        text-color="#409EFF"
        active-text-color="#ffd04b">
          <el-menu-item-group class="over-hide" v-for="item in menu" :key="item.componentName">
            <el-menu-item :index="item.componentName" v-text="item.name"  style="text-align:center" >
            </el-menu-item>
          </el-menu-item-group>
      </el-menu>
    </el-col>
  </el-row>
</template>

<style scoped>
.over-hide{
  overflow: hidden;
}
</style>

<script>
  import menu from '@/config/menu-config'

  export default {
    data () {
      return {
        menu: menu
      }
    },
    methods: {
      handleOpen (key, keyPath) {
        console.log(key, keyPath)
      },
      handleClose (key, keyPath) {
        console.log(key, keyPath)
      }
    }
  }
</script>